<!--<?php
print <<<EOT
-->
EOT;
require_once Pcv($logic_file_path."groups.php");
require modeEot('header');
print <<<EOT
<script type="text/javascript">
function swap_tab(n,m){
try{
	for(var i=1;i<=m;i++){
		var curC=document.getElementById("tab_"+i);
		var curB=document.getElementById("tab_t"+i);
		if(n==i){
			curC.style.display="block";
			curB.className="current"
		}else{
			curC.style.display="none";
			curB.className=""
		}
	}}catch(e){}
}
function swap_tab2(n,m){
try{
	for(var i=1;i<=m;i++){
		var curC=document.getElementById("tab2_"+i);
		var curB=document.getElementById("tab2_t"+i);
		if(n==i){
			curC.style.display="block";
			curB.className="current"
		}else{
			curC.style.display="none";
			curB.className=""
		}
	}}catch(e){}
}
</script>
<style>
	.mygroups{font-family: ''cb'ce'cc'e5'; color: rgb(0, 0, 255); font-size: 13px;}
</style>
	<div id="borderTop"></div>
	<div id="mainContent">
		<div class="g_navA">
			<a href="apps.php?q=groups&" class="s4 fr">查看我的群组>></a>
			<ul id="nav"><div class="view-hover" altname="群组标题@群组" channelid="groups">	<li onmouseover="return swap_tab(1,4);" id="tab_t1" class="current"><a href="javascript:;">推荐群组</a></li>
	<li onmouseover="return swap_tab(2,4);" id="tab_t2"><a href="javascript:;">热门群组</a></li>
	<li onmouseover="return swap_tab(3,4);" id="tab_t3"><a href="javascript:;">最新群组</a></li>
	<li onmouseover="return swap_tab(4,4);" onclick="ajax.send('pw_ajax.php?action=showrandcolonys','',showRandColonys)" id="tab_t4"><a href="javascript:;">随机群组</a></li>
<script language="JavaScript">
function showRandColonys(){
	var randColonysHTML = ajax.request.responseText;
	getObj('tab_4').innerHTML = randColonysHTML;
}
</script>



</div></ul>
<!--
EOT;
if($o_newcolony){print<<<EOT
-->
			<a href="apps.php?q=groups&a=create" class="chuangjian">创建群组</a>
<!--
EOT;
}print<<<EOT
-->
		</div>
		<div class="content">
			<div id="tab_1" class="groups cc"><div class="view-hover" altname="群组列表_1@群组" channelid="groups">
EOT;
$pwresult = pwTplGetData('群组列表_1@群组','群组列表');
print <<<EOT
<ul>
EOT;
foreach($pwresult as $key=>$val){print <<<EOT
<li>
		<a href="$val[url]" target="_blank"><img class="fl" src="$val[image]" width="64" height="64" /></a>
		<h4><a href="$val[url]" target="_blank">$val[title]</a></h4>
		<p>$val[descrip]</p>
	</li>
EOT;
}print <<<EOT
</ul>

</div></div>
			<div id="tab_2" class="groups cc" style="display:none"><div class="view-hover" altname="群组列表_2@群组" channelid="groups">
EOT;
$pwresult = pwTplGetData('群组列表_2@群组','群组列表');
print <<<EOT
<ul>
EOT;
foreach($pwresult as $key=>$val){print <<<EOT
<li>
		<a href="$val[url]" target="_blank"><img class="fl" src="$val[image]" width="64" height="64" /></a>
		<h4><a href="$val[url]" target="_blank">$val[title]</a></h4>
		<p>$val[descrip]</p>
	</li>
EOT;
}print <<<EOT
</ul>

</div></div>
			<div id="tab_3" class="groups cc" style="display:none"><div class="view-hover" altname="群组列表_3@群组" channelid="groups">
EOT;
$pwresult = pwTplGetData('群组列表_3@群组','群组列表');
print <<<EOT
<ul>
EOT;
foreach($pwresult as $key=>$val){print <<<EOT
<li>
		<a href="$val[url]" target="_blank"><img class="fl" src="$val[image]" width="64" height="64" /></a>
		<h4><a href="$val[url]" target="_blank">$val[title]</a></h4>
		<p>$val[descrip]</p>
	</li>
EOT;
}print <<<EOT
</ul>




</div></div>
			<div id="tab_4" class="groups cc" style="display:none">
			<ul>
<!--
EOT;
foreach($randColonys as $key => $value) {print<<<EOT
-->
			<li>
				<a href="apps.php?q=group&cyid={$value[id]}" target="_blank"><img class="fl" src="{$value[cnimg]}" width="64" height="64" /></a>
				<h4><a href="apps.php?q=group&cyid={$value[id]}"  target="_blank">{$value[cname]}</a></h4>
				<p>{$value[descrip]}</p>
			</li>
		
<!--
EOT;
}print<<<EOT
-->
			</ul>
			</div>
			<div class="group-types">
				<div class="hd">
					<h3><a href="apps.php?q=groups&a=all">群组分类</a></h3>
					<span class="more"><a href="apps.php?q=groups&a=all">共有<em>{$colonyNums}</em>个群组</a></span>
				</div>
				<div class="bd">
					<div class="bdWrap cc">
					<dl>
						<dt><div class="view-hover" altname="业主小区hd@群组" channelid="groups"><a href="javascript:;">业主小区</a> <span>(0)</span>

</div></dt>
						<dd><div class="view-hover" altname="业主小区bd@群组" channelid="groups">
EOT;
$pwresult = pwTplGetData('业主小区bd@群组','群组列表');
foreach($pwresult as $key=>$val){print <<<EOT
<a href="$val[url]" target="_blank" title="$val[title]">$val[title]</a>
EOT;
}print <<<EOT
</div></dd>
					</dl>
					<dl>
						<dt><div class="view-hover" altname="爱车一族hd@群组" channelid="groups"><a href="javascript:;">爱车一族</a> <span>(0)</span>

</div></dt>
						<dd><div class="view-hover" altname="爱车一族bd@群组" channelid="groups">
EOT;
$pwresult = pwTplGetData('爱车一族bd@群组','群组列表');
foreach($pwresult as $key=>$val){print <<<EOT
<a href="$val[url]" target="_blank" title="$val[title]">$val[title]</a>
EOT;
}print <<<EOT
</div></dd>
					</dl>
					<dl>
						<dt><div class="view-hover" altname="运动和爱好hd@群组" channelid="groups"><a href="javascript:;">运动和爱好</a> <span>(0)</span>

</div></dt>
						<dd><div class="view-hover" altname="运动和爱好bd@群组" channelid="groups">
EOT;
$pwresult = pwTplGetData('运动和爱好bd@群组','群组列表');
foreach($pwresult as $key=>$val){print <<<EOT
<a href="$val[url]" target="_blank" title="$val[title]">$val[title]</a>
EOT;
}print <<<EOT
</div></dd>
					</dl>
					<dl>
						<dt><div class="view-hover" altname="拉风汽车hd@群组" channelid="groups"><a href="javascript:;">拉风汽车</a> <span>(0)</span>

</div></dt>
						<dd><div class="view-hover" altname="拉风汽车bd@群组" channelid="groups">
EOT;
$pwresult = pwTplGetData('拉风汽车bd@群组','群组列表');
foreach($pwresult as $key=>$val){print <<<EOT
<a href="$val[url]" target="_blank" title="$val[title]">$val[title]</a>
EOT;
}print <<<EOT
</div></dd>
					</dl>
					</div>
				</div>
			</div>
			<div class="g_navA">
			<div class="view-hover" altname="最热最新@群组" channelid="groups"><ul>
	<li onmouseover="return swap_tab2(1,2);" id="tab2_t1" class="current"><a href="javascript:;">热门话题</a></li>
	<li onmouseover="return swap_tab2(2,2);" id="tab2_t2"><a href="javascript:;">最新话题</a></li>
</ul>
			

</div>
			</div>
			<div class="topics">
				<div id="tab2_1"><div class="view-hover" altname="群组最热@群组" channelid="groups">
EOT;
$pwresult = pwTplGetData('群组最热@群组','群组帖子列表');
print <<<EOT
<table cellpadding="0" cellspacing="0">
<thead>
	<tr>
		<th class="title">主题</th>
		<th class="groups" width="120">所属群组</th>
		<th class="author" width="90">作者(回复/人气)</th>
		<th class="lastReply" width="90">最后回复</th>
	</tr>
</thead>
<tbody>
EOT;
foreach($pwresult as $key=>$val){
$creditclass = $key%2 == 0 ? '' : 'odd';
print <<<EOT
<tr class="$creditclass vt">
		<td class="title">
			<p><a href="$val[url]" target="_blank">$val[title]</a></p>
		</td>
		<td><a href="apps.php?q=group&cyid=$val[cyid]" target="_blank">$val[cname]</a></td>
		<td><a href="u.php?uid=$val[authorid]" target="_blank">$val[author]</a><br />$val[replies]/$val[hits]</td>
		<td><a href="u.php?username=$val[lastposter]" target="_blank">$val[lastposter]</a><br />$val[lastpost]</td>
	</tr>
EOT;
}print <<<EOT
</tbody>
</table>


</div></div>
				<div id="tab2_2" style="display:none;"><div class="view-hover" altname="群组最新@群组" channelid="groups">
EOT;
$pwresult = pwTplGetData('群组最新@群组','群组帖子列表');
print <<<EOT
<table cellpadding="0" cellspacing="0">
<thead>
	<tr>
		<th class="title">主题</th>
		<th class="groups" width="120">所属群组</th>
		<th class="author" width="90">作者(回复/人气)</th>
		<th class="lastReply" width="90">最后回复</th>
	</tr>
</thead>
<tbody>
EOT;
foreach($pwresult as $key=>$val){
$creditclass = $key%2 == 0 ? '' : 'odd';
print <<<EOT
<tr class="$creditclass vt">
		<td class="title">
			<p><a href="$val[url]" target="_blank">$val[title]</a></p>
		</td>
		<td><a href="apps.php?q=group&cyid=$val[cyid]" target="_blank">$val[cname]</a></td>
		<td><a href="u.php?uid=$val[authorid]" target="_blank">$val[author]</a><br />$val[replies]/$val[hits]</td>
		<td><a href="u.php?username=$val[lastposter]" target="_blank">$val[lastposter]</a><br />$val[lastpost]</td>
	</tr>
EOT;
}print <<<EOT
</tbody>
</table>
					



</div></div>
			</div>
		</div>
		<div class="sidebar">
			<div class="side-box">
				<h3>热门群组</h3>
				<div class="view-hover" altname="top20@群组" channelid="groups">
<ol class="ranking">
EOT;
$pwresult = pwTplGetData('top20@群组','群组列表');
foreach($pwresult as $key=>$val){
$creditclass = $key%2 == 0 ? '' : 'odd';
$tempKey = $key+1<10 ? '0'.($key+1) : $key+1;
print <<<EOT
<li class="$creditclass">
		<a href="$val[url]" target="_blank"><em>$tempKey</em><span class="title">$val[title]</span><span class="order">$val[credit]</span></a>
	</li>
EOT;
}print <<<EOT
</ol>

</div>
			</div>
			<div class="side-box">
				<h3>他(她)刚刚加入</h3>
				<ul class="users cc">
<!--
EOT;
foreach ($newmembers as $key => $value){print<<<EOT
-->
					<li>
						<a href="u.php?uid={$value[uid]}" target="_blank"><img class="fl" src="$value[faceurl]" width="48" height="48" /></a>
						<h4><a href="u.php?uid={$value[uid]}" target="_blank">{$value[username]}</a></h4>
						<p>加入了 <span class="b"><a href="apps.php?q=group&cyid={$value[cyid]}" target="_blank">{$value[cname]}</a></span></p>
					</li>
<!--
EOT;
}print<<<EOT
-->
				</ul>
			</div>
		</div>
		
		<div class="c"></div>
	</div>
EOT;
require modeEot('footer');
print <<< EOT

<!--
EOT;
?>-->
